package com.home.cop.enums.sysinfo;

public enum EmployeeStatusEnum {
    ENABLE("启用",0),DISABLE("禁用",1);

    private Integer code;
    private String name;

    private EmployeeStatusEnum(String name, Integer code){
        this.code = code;
        this.name = name;
    }
    public static boolean contains(int code) {
        for (EmployeeStatusEnum flagEnum : EmployeeStatusEnum.values()) {
            if (flagEnum.getCode() == code) {
                return true;
            }
        }
        return false;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String getNameByCode(Integer code){
        if (code == null){
            return "";
        }
        for (EmployeeStatusEnum e:EmployeeStatusEnum.values()){
            if(e.getCode() == code){
                return e.getName();
            }
        }
        return "";
    }

}
